///*
// * ResearchJPanel.java
// *
// * Created on 16.05.2009, 20:53:22
// */
//package morenoapp.components.research;
//
//import java.awt.Color;
//
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//import java.util.Calendar;
//import java.util.Date;
//import morenoapp.MorenoActions;
//import morenoapp.MorenoApp;
//import morenoapp.model.enums.MorenoPollType;
//import morenoapp.model.listeners.MorenoModelAdapter;
//import morenoapp.util.I18N;
//import morenoapp.util.MorenoUtil;
//import org.jdesktop.application.Action;
//
///**
// *
// * @author dmitry.mamonov
// */
//@Deprecated
//public class ResearchJPanel extends javax.swing.JPanel {
//    /** Creates new form ResearchJPanel */
//    public ResearchJPanel() {
//        initComponents();
//
//        MorenoApp.getModel().addModelListener(new MorenoModelAdapter() {
//            @Override
//            public void onWholeModelChanged() {
//                firePropertyChange("modelDescription", null, getModelDescription()); //NOI18N
//                firePropertyChange("modelSupervisor", null, getModelSupervisor()); //NOI18N
//                if (isModelLimitedPollParametric()) {
//                    jRadioButtonParametricResearch.setSelected(true);
//                } else {
//                    jRadioButtonNonParametricResearch.setSelected(true);
//                }
//                firePropertyChange("modelPollDate", null, getModelPollDate()); //NOI18N
//                firePropertyChange("modelPollDateForeground", null, getModelPollDateForeground()); //NOI18N
//                firePropertyChange("modelReseachTypeHelp", null, getModelReseachTypeHelp()); //NOI18N
//            }
//        });
//
//        jButtonNext.setAction(MorenoActions.getActionNavigateNext());
//        jRadioButtonParametricResearch.addActionListener(new ActionListener() {
//            public void actionPerformed(ActionEvent e) {
//                actionSetParametricPoll();
//            }
//        });
//        jRadioButtonNonParametricResearch.addActionListener(new ActionListener() {
//            public void actionPerformed(ActionEvent e) {
//                actionSetNonParametricPoll();
//            }
//        });
//    }
//
//    /** This method is called from within the constructor to
//     * initialize the form.
//     * WARNING: Do NOT modify this code. The content of this method is
//     * always regenerated by the Form Editor.
//     */
//    @SuppressWarnings("unchecked")
/*
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        buttonGroupResearchType = new javax.swing.ButtonGroup();
        jLabelDescription = new javax.swing.JLabel();
        jScrollPaneDescription = new javax.swing.JScrollPane();
        jTextAreaDescription = new javax.swing.JTextArea();
        jLabelSupervisor = new javax.swing.JLabel();
        jTextFieldSupervisor = new javax.swing.JTextField();
        jTextFieldPollDate = new javax.swing.JTextField();
        jLabelPollDate = new javax.swing.JLabel();
        jRadioButtonParametricResearch = new javax.swing.JRadioButton();
        jRadioButtonNonParametricResearch = new javax.swing.JRadioButton();
        jScrollPaneResearchTypeHelp = new javax.swing.JScrollPane();
        jTextPaneResearchTypeHelp = new javax.swing.JTextPane();
        jButtonNext = new javax.swing.JButton();
        jPanelLeftSpacer = new javax.swing.JPanel();
        jLabelDateFormartHelp = new javax.swing.JLabel();

        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(ResearchJPanel.class);
        jLabelDescription.setText(resourceMap.getString("jLabelDescription.text")); // NOI18N
        jLabelDescription.setName("jLabelDescription"); // NOI18N

        jScrollPaneDescription.setName("jScrollPaneDescription"); // NOI18N

        jTextAreaDescription.setColumns(20);
        jTextAreaDescription.setFont(resourceMap.getFont("textResearchDescription.font")); // NOI18N
        jTextAreaDescription.setRows(5);
        jTextAreaDescription.setName("textResearchDescription"); // NOI18N

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${modelDescription}"), jTextAreaDescription, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        jScrollPaneDescription.setViewportView(jTextAreaDescription);

        jLabelSupervisor.setText(resourceMap.getString("jLabelSupervisor.text")); // NOI18N
        jLabelSupervisor.setName("jLabelSupervisor"); // NOI18N

        jTextFieldSupervisor.setName("textSupervisor"); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${modelSupervisor}"), jTextFieldSupervisor, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        jTextFieldPollDate.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
        jTextFieldPollDate.setName("dataPollDate"); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${modelPollDate}"), jTextFieldPollDate, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);
        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${modelPollDateForeground}"), jTextFieldPollDate, org.jdesktop.beansbinding.BeanProperty.create("foreground"));
        bindingGroup.addBinding(binding);

        jLabelPollDate.setText(resourceMap.getString("jLabelPollDate.text")); // NOI18N
        jLabelPollDate.setName("jLabelPollDate"); // NOI18N

        buttonGroupResearchType.add(jRadioButtonParametricResearch);
        jRadioButtonParametricResearch.setText(resourceMap.getString("radioParametricResearch.text")); // NOI18N
        jRadioButtonParametricResearch.setName("radioParametricResearch"); // NOI18N

        buttonGroupResearchType.add(jRadioButtonNonParametricResearch);
        jRadioButtonNonParametricResearch.setText(resourceMap.getString("radioNonParametricResearch.text")); // NOI18N
        jRadioButtonNonParametricResearch.setName("radioNonParametricResearch"); // NOI18N

        jScrollPaneResearchTypeHelp.setName("jScrollPaneResearchTypeHelp"); // NOI18N

        jTextPaneResearchTypeHelp.setContentType(resourceMap.getString("jTextPaneResearchTypeHelp.contentType")); // NOI18N
        jTextPaneResearchTypeHelp.setEditable(false);
        jTextPaneResearchTypeHelp.setName("jTextPaneResearchTypeHelp"); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${modelReseachTypeHelp}"), jTextPaneResearchTypeHelp, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        jScrollPaneResearchTypeHelp.setViewportView(jTextPaneResearchTypeHelp);

        jButtonNext.setIcon(resourceMap.getIcon("buttonNext.icon")); // NOI18N
        jButtonNext.setText(resourceMap.getString("buttonNext.text")); // NOI18N
        jButtonNext.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
        jButtonNext.setName("buttonNext"); // NOI18N

        jPanelLeftSpacer.setName("jPanelLeftSpacer"); // NOI18N

        javax.swing.GroupLayout jPanelLeftSpacerLayout = new javax.swing.GroupLayout(jPanelLeftSpacer);
        jPanelLeftSpacer.setLayout(jPanelLeftSpacerLayout);
        jPanelLeftSpacerLayout.setHorizontalGroup(
            jPanelLeftSpacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 57, Short.MAX_VALUE)
        );
        jPanelLeftSpacerLayout.setVerticalGroup(
            jPanelLeftSpacerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 370, Short.MAX_VALUE)
        );

        jLabelDateFormartHelp.setText(resourceMap.getString("jLabelDateFormartHelp.text")); // NOI18N
        jLabelDateFormartHelp.setName("jLabelDateFormartHelp"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButtonNext)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanelLeftSpacer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jRadioButtonNonParametricResearch)
                            .addComponent(jRadioButtonParametricResearch)
                            .addComponent(jLabelDescription)
                            .addComponent(jLabelSupervisor)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabelPollDate)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextFieldPollDate, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelDateFormartHelp))
                            .addComponent(jTextFieldSupervisor)
                            .addComponent(jScrollPaneResearchTypeHelp, javax.swing.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)
                            .addComponent(jScrollPaneDescription))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanelLeftSpacer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelDescription)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPaneDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelSupervisor)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldSupervisor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldPollDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelPollDate)
                            .addComponent(jLabelDateFormartHelp))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioButtonParametricResearch)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioButtonNonParametricResearch)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPaneResearchTypeHelp, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonNext)
                .addContainerGap(45, Short.MAX_VALUE))
        );

        bindingGroup.bind();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroupResearchType;
    private javax.swing.JButton jButtonNext;
    private javax.swing.JLabel jLabelDateFormartHelp;
    private javax.swing.JLabel jLabelDescription;
    private javax.swing.JLabel jLabelPollDate;
    private javax.swing.JLabel jLabelSupervisor;
    private javax.swing.JPanel jPanelLeftSpacer;
    private javax.swing.JRadioButton jRadioButtonNonParametricResearch;
    private javax.swing.JRadioButton jRadioButtonParametricResearch;
    private javax.swing.JScrollPane jScrollPaneDescription;
    private javax.swing.JScrollPane jScrollPaneResearchTypeHelp;
    private javax.swing.JTextArea jTextAreaDescription;
    private javax.swing.JTextField jTextFieldPollDate;
    private javax.swing.JTextField jTextFieldSupervisor;
    private javax.swing.JTextPane jTextPaneResearchTypeHelp;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
*/
//    public String getModelDescription() {
//        return MorenoApp.getModel().getDescription();
//    }
//
//    public void setModelDescription(String modelDescription) {
//        MorenoApp.getModel().setDescription(modelDescription);
//    }
//
//    public String getModelPollDate() {
//        return MorenoUtil.dateToStringDate(MorenoApp.getModel().getPollDate());
//    }
//
//    public Color getModelPollDateForeground() {
//        Date modelPollDate = MorenoApp.getModel().getPollDate();
//        int year = 0;
//        if (modelPollDate != null) {
//            Calendar c = Calendar.getInstance();
//            c.setTime(modelPollDate);
//            year = c.get(Calendar.YEAR);
//        }
//        if (modelPollDate == null || year < 1900 || year > 3000) {
//            return Color.gray;
//        } else {
//            return Color.black;
//        }
//    }
//
//    public void setModelPollDate(String modelPollDate) {
//        Date modelPollDateDate = MorenoUtil.stringDateToDate(modelPollDate);
//        MorenoApp.getModel().setPollDate(modelPollDateDate);
//        firePropertyChange("modelPollDateForeground", null, getModelPollDateForeground()); //NOI18N
//        System.out.println("model date: " + modelPollDateDate + " / " + modelPollDate); //NOI18N
//    }
//
//    public String getModelSupervisor() {
//        return MorenoApp.getModel().getSupervisorInfo();
//    }
//
//    public void setModelSupervisor(String modelSupervisor) {
//        MorenoApp.getModel().setSupervisorInfo(modelSupervisor);
//    }
//
//    public boolean isModelLimitedPollParametric() {
//        return MorenoApp.getModel().getPollType() == MorenoPollType.ParametricPoll;
//    }
//
//    public String getModelReseachTypeHelp() {
//        if (isModelLimitedPollParametric()) {
//            return I18N.get("label.parametric_research_description_html");
//        } else {
//            return I18N.get("label.nonparametric_research_description_html");
//        }
//    }
//
//    @Action
//    public void actionSetParametricPoll() {
//        MorenoApp.getModel().setPollType(MorenoPollType.ParametricPoll);
//        firePropertyChange("modelReseachTypeHelp", null, getModelReseachTypeHelp()); //NOI18N
//    }
//
//    @Action
//    public void actionSetNonParametricPoll() {
//        MorenoApp.getModel().setPollType(MorenoPollType.NonParametricPoll);
//        firePropertyChange("modelReseachTypeHelp", null, getModelReseachTypeHelp()); //NOI18N
//    }
//}
